* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f5f6fa;
  color: #333;
}

/* 自定义滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 为表格容器添加特殊的滚动条样式 */
.table-scroll-container {
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

/* 强制显示水平滚动条的样式 */
.force-horizontal-scroll {
  overflow-x: scroll !important;
  overflow-y: visible !important;
  scrollbar-width: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* 库存表格容器的滚动条样式 */
.inventory-table-container::-webkit-scrollbar {
  height: 12px;
}

.inventory-table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

.inventory-table-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 6px;
}

.inventory-table-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.force-horizontal-scroll::-webkit-scrollbar {
  height: 16px !important;
  width: 16px !important;
  background: transparent !important;
}

.force-horizontal-scroll::-webkit-scrollbar-track {
  background: #f1f3f4 !important;
  border-radius: 8px !important;
  border: 1px solid #e0e0e0 !important;
}

.force-horizontal-scroll::-webkit-scrollbar-thumb {
  background: #9aa0a6 !important;
  border-radius: 8px !important;
  border: 2px solid #f1f3f4 !important;
}

.force-horizontal-scroll::-webkit-scrollbar-thumb:hover {
  background: #5f6368 !important;
}

.force-horizontal-scroll::-webkit-scrollbar-corner {
  background: #f1f3f4 !important;
}

html, body {
  overflow-x: hidden;  /* 禁用页面横向滚动 */
  width: 100%;
  margin: 0;
  padding: 0;
}

.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;  /* 防止溢出 */
}

.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 24px;
  background: #f5f6fa;
  min-height: 100vh;
  overflow: hidden;  /* 改为 hidden 防止溢出 */
  width: calc(100% - 280px);  /* 精确计算宽度 */
  box-sizing: border-box;
}

.container {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid #e9ecef;
  overflow: visible;
}

.card h2 {
  margin-bottom: 20px;
  color: #2c3e50;
  font-size: 24px;
  font-weight: 600;
}

.card h3 {
  color: #34495e;
  font-size: 18px;
  font-weight: 500;
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  text-align: center;
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-number {
  font-size: 32px;
  font-weight: bold;
  color: #3498db;
  margin-bottom: 8px;
  line-height: 1;
}

.stat-label {
  color: #7f8c8d;
  font-size: 14px;
  font-weight: 500;
}

/* 表单样式 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 6px;
  font-weight: 500;
  color: #495057;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 状态标签 */
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    padding: 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .table {
    font-size: 13px;
  }
  
  .table th,
  .table td {
    padding: 8px 12px;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #bdc3c7;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #95a5a6;
}